Method and apparatus for reducing clock frequency during low workload periods

ABSTRACT

A clock frequency control unit for an integrated circuit (IC) includes a clock generator, a finite state machine (FSM), and a gating circuit (GC). The FSM has at least first and second states corresponding to non-low workload low workload states, respectively. In the first state, the GC provides a clock signal to functional units of the IC with the same frequency as the clock generator output. In the second state, the GC reduces the frequency of the clock signal. In one embodiment, the GC masks out selected cycles of the clock generator output to reduce the clock signal frequency. The FSM monitors the operation of the IC to transition from the first state to the second state when selected “low workload” conditions are detected (e.g., long latency cache miss). Similarly, the FSM transitions from the second state to the first state when selected “non-low workload” conditions are detected.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a divisional of prior application Ser. No.10/260,995, filed Sep. 30, 2002.

FIELD OF THE INVENTION

Embodiments of the present invention relate to processor and, moreparticularly but not exclusively, to clock circuits for use inprocessors.

BACKGROUND INFORMATION

A semiconductor integrated circuit (IC) device, such as a processor, mayinclude circuitry of many types of discrete circuit components,including transistors, resistors, and capacitors, as well as othercomponents. Semiconductor IC manufacturers are subject toever-increasing pressure to increase the speed (i.e. the clock rate) andperformance of such IC devices while reducing package size andmaintaining reliability. Thus, by way of example, a modem processor(e.g., general purpose microprocessors, digital signal processors,microcontrollers, etc.) may be implemented in a die that includesliterally millions of closely spaced transistors and other discretesub-micron components and operating at clock rates in the GHz range. Asis well known, the power dissipation of a processor (and other ICdevices) generally increases with operating frequency. As a result,these modern processors exhibit relatively high power dissipation. Highpower dissipation is generally undesirable and can be especiallyproblematic in battery-powered applications.

One conventional technique to reduce power dissipation is “clockthrottling”. Typical clock throttling techniques include reducing thefrequency of a clock signal provided to selected units or subunits ofthe processor. Clock throttling tends to reduce the performance of theprocessor since the clock frequency is reduced even when the processoris trying to perform useful work. In addition, current clock throttlingsolutions are relatively coarse (i.e., take a relatively large number ofclock cycles to enter the reduced clock frequency mode and to return tothe normal clock frequency mode).

Another conventional technique is to reduce the supply voltage providedto the processor. The lower supply voltage tends to slow the switchingspeed of the transistors in the processor, which in turn tends to reducethe performance of the processor. In addition, the lower supply voltagemay undesirable increase the processor's noise sensitivity. Further,like clock throttling, changing the supply voltage is a relativelycoarse power conservation technique. This technique is widely used as anefficient way of reducing power dissipation as the power relates to thevoltage in the power of three. For example, lowering the voltage by 20%would lower the power by 49%, while hurting the performance (clock rate)by only 20%. The limitation is that it takes many millions of clockcycles to stabilize a new voltage on an IC.

These clock throttling and voltage reduction techniques are commonlyused in controlling the temperature of the processor and, thus, theaforementioned shortcomings are acceptable to prevent damage to theprocessor. However, for purely power conservation applications, theseshortcomings may be unacceptable.

BRIEF DESCRIPTION OF THE DRAWINGS

Non-limiting and non-exhaustive embodiments of the present invention aredescribed with reference to the following figures, wherein likereference numerals refer to like parts throughout the various viewsunless otherwise specified.

FIG. 1 is a block diagram illustrating a computer system having a clockfrequency control unit according to one embodiment of the presentinvention.

FIG. 2 is a flow diagram illustrating the operational flow of the systemof FIG. 1, according to one embodiment of the present invention.

FIG. 3 is a block diagram illustrating an implementation of the clockfrequency control unit of FIG. 1, according to an embodiment the presentinvention.

FIG. 4 is a diagram illustrating an implementation of the gating circuitof FIG. 3, according to one embodiment of the present invention.

FIG. 5 is a timing diagram illustrating the timing of the gating circuitof FIG. 4, according to one embodiment of the present invention.

FIG. 6 is a schematic diagram illustrating an implementation of the maskgenerator of FIG. 4, according to one embodiment of the presentinvention.

FIG. 7 is a diagram illustrating an implementation of the gating circuitof FIG. 3 for use with a source synchronous bus, according to anembodiment of the present invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Embodiments of the present invention are described below in the contextof power management of a processor; however, in light of the presentdisclosure, those of ordinary skill in the art will understand that thepresent description is generally applicable to all types of IC devices.

FIG. 1 illustrates a computer system 10 having a processor 11 with aclock frequency control unit 14, according to one embodiment of thepresent invention. This embodiment of computer system 10 also includes amain memory 12, a read only memory (ROM) 13, a core clock a bus 15, afirst level or internal cache 16 (embedded in processor 11), and asecond level or external cache 17. In some embodiments, the second levelcache is integrated with the processor and/or there may be other levelsof caches either internal or external. Embodiments of clock frequencycontrol unit 14 are described in more detail below in conjunction withFIGS. 3-8.

Processor 11 is coupled via a bus 15 to main memory 12, which maycomprise one or more dynamic random access memory (DRAM) devices forstoring information and instructions to be executed by processor 11.Main memory 12 may also be used for storing temporary variables or otherintermediate information during execution of instructions by processor11. ROM 13, for storing static information and instructions forprocessor 11, is coupled to processor 11 via bus 15.

Although not shown in FIG. 1, processor 11 typically includes aninstruction decoder unit, an execution unit, internal clock circuitry, aregister file unit, address translation unit and a bus interface unit,all implemented on a semiconductor die. The bus interface unit iscoupled to bus 15, as well as main memory 12 and ROM 13. The businterface unit facilitates transmission of data between main memory 12and processor 11, and performs fetching of instructions and other datafrom ROM 13. The address translation unit performs memory management forprocessor 11. For example, the address translation unit stores thememory addresses (whether in main memory 12, internal cache 16, or othermemory) of data being used by the processor 11 during operation. Theinstruction decoder unit decodes instructions and other control signalsreceived by processor 11.

The execution unit is intended to present a broad category ofmicroprocessor functional units providing a wide range of functions. Byway of example, the execution unit may include an arithmetic and logicunit for performing arithmetic operations, including shifts, addition,subtraction, multiplication, and division. The register file unit mayinclude one or more types of registers for storing data being used byprocessor 11. For example, the register file unit may include integerregisters, status registers, instruction pointer registers, and floatingpoint registers, as well as others. If present, the internal cache maybe used, for example, to store data and control signals from main memory12.

The internal clock circuitry may include a phase lock loop (PLL) circuitfor adjusting the external clock frequency (either increasing ordecreasing this frequency) to achieve a desired operating frequency forprocessor 11. In some embodiments, the Internal clock circuitry outputsthe processor core clock signal(s). In one embodiment, core clockfrequency control (CCFC) unit 14 is part of internal clock circuitry.

Further, computer system 10 can include other devices (not shown) thatare coupled to processor 11 (typically via bus 15). For example, inputdevices, such as a keyboard or mouse, are coupled to processor 11.Output devices are also coupled to processor 11. Typical output devicesinclude printers and display monitors. Data storage devices are alsocoupled to processor 11. Common data storage devices include hard diskdrives, floppy disk drives, and CD ROM drives. In one embodiment,processor 11 is also coupled to a supply voltage source (not shown) andan external clock source (not shown).

In light of this disclosure, those of ordinary skill in the art willunderstand that computer system 10 may include other components andsubsystems in addition to those shown and described with respect toFIG. 1. By way of example, computer system 10 may include video memory,as well as other dedicated memory, and additional signal lines andbusses.

The embodiment of processor 11 presented in FIG. 1 is illustrative. Inlight of this disclosure, those of ordinary skill in the art willunderstand that, in practice, a modern processor is generally morecomplex and may include additional components. To improve clarity, FIG.1 does not show internal buses and other communication paths thatelectrically interconnect the various functional units of processor 11(e.g., the aforementioned bus interface unit, address translation unit,instruction decode unit, execution unit, and register file unit).Accordingly, processor 11 is presented without limitation, and thepresent invention is generally applicable to all types of processors(e.g., microprocessors, microcontrollers, digital signal processors,etc.), irrespective of the specific architecture employed.

Core Clock Frequency Control

In one embodiment, CCFC unit 14 is configured to interface with one ormore of the functional units on processor 11, as well as the internalclock circuitry. CCFC unit 14 is configured to detect events withinprocessor 11 that indicate or precede periods of low processor workload.For example, in some processors, an external cache miss can cause theprocessor to perform idle operations for hundreds of core clock cycles.During such low workload periods, the core clock frequency can bereduced with little or no impact on performance. In one embodiment, thecore clock frequency is reduced to the operating frequency of bus 15during low workload periods. In other embodiments, frequency of the coreclock frequency can be reduced to other speeds. The core clock can evenbe completely stopped in other embodiments, but some of the processor'sfunctions should be maintained (e.g., the bus interface to bus 15 todetect when the low workload condition ends, accept snoop requests, orother important events).

FIG. 2 illustrates the operational flow of system 10 (FIG. 1) inreducing the core clock frequency during low workload periods, accordingto one embodiment of the present invention. Referring to FIGS. 1 and 2,this embodiment of system 10 operates as follows.

The operation of processor 11 is monitored for selected conditions thatindicate or precede a low workload period as shown in a block 21. In oneembodiment, CCFC unit 14 monitors the operation of processor 11 for theselected conditions. For example, CCFC unit 14 can monitor a cache misssignal that is provided by external cache 17. External cache 17 assertsthis signal when a cache miss occurs (e.g., a data miss). Typically,external cache 17 will also requests a block of data from main memory12. While the data is being retrieved (typically requiring hundreds of“fast” core clock cycles), processor 11 is mainly idle.

Another example of a low workload period can occur in processorarchitectures having an out-of-order dispatcher and in-order instructionqueue. In such architectures, a significant low workload period canoccur when a code miss or an instruction cache miss occurs and theprocessor's out-of-order dispatcher and in-order instruction queue areempty. There are other events that can also cause processor 11 to “idle”for significant numbers of “fast” core clock cycles, depending on thearchitecture and/or configuration of the processor.

In addition, for some events, there may be additional conditions thatshould be monitored to determine whether the event would result in a lowworkload period. For example, a data miss in the external cachegenerally results in a low workload period, but in some processorarchitectures (e.g., pipelined, out-of-order etc.), the processor maycontinue to do useful work for a relatively short period of time after acache miss. Thus, in some embodiments, additional conditions may beincluded. For example, a grace period may be added after the cache misssignal is asserted to allow pipelined operations to be completed.

If the selected conditions are not met, as shown by a block 22, theoperational flow returns to block 21 to continue monitoring. However, ifthe conditions are met, the core clock frequency is reduced, asindicated by a block 23. In one embodiment, CCFC unit 14 reduces thefrequency of the core clock signal to the operating frequency of bus 15.Further, in one embodiment, CCFC unit 14 reduces the core clockfrequency (as received by functional units of processor 11 ) by maskingsome clock cycles of the “fast” core clock signal, rather than byadjusting the output frequency of an oscillator, a PLL, or delay lockedloop.

The operation of processor 11 is then monitored for selected conditionsthat indicate that the low workload period has ended, as shown in ablock 25. In one embodiment, CCFC unit 14 monitors the operation ofprocessor 11 for the selected conditions. For example, CCFC unit 14 mayreceive a “memory ready” signal after the cache miss, which indicatesthat the processor may now stop idling and perform useful work. In otherembodiments, these conditions may include the processor receiving asnoop request via bus 15, an interrupt signal, a reset signal, aninitialize signal, or a stop clock signal, or other signal that requiresa fast response from the processor. If the conditions are not met, theoperational flow returns to block 25. However, if the conditions aremet, the core clock frequency is increased. In one embodiment,terminating the masking of core clock signal cycles increases the coreclock frequency. After the core clock frequency is increased, theoperational flow returns to block 21.

FIG. 3 illustrates an implementation of CCFC unit 14 (FIG. 1), accordingto an embodiment of the present invention. In this embodiment, CCFC unit14 includes a finite state machine 31, a phase lock loop 32, and agating circuit 33.

In one embodiment, finite state machine 31 is implemented in hardwareusing combinatorial logic and has two states. One state is a “fast” coreclock state 31A and the other is a “slow” core clock state 31B. The“fast” core clock state 31A can be entered from either a RESET operation(e.g., when the processor is first powered up) or from the “slow” coreclock state 31B when selected “speed up” conditions are detected. The“slow” core clock state 31B can be entered from the “fast” core clockstate 31A when selected “slow down” conditions are detected. When CCFCunit 14 is in the “slow” core clock state 31B, finite state machine 31asserts a SLOW_SELECT signal and de-asserts the SLOW_SELECT signal whenin the “fast” core clock state. Other embodiments may have more than twostates for a tiered power reduction scheme. For example, there may be astate for a middle clock rate or a stop clock state.

In addition, some embodiments of finite state machine 31 can includecounters, e.g. K, M and N, for tracking grace periods that can form partof the conditions for state transitions. For example, in one embodimentused in out-of-order architectures, the K counter can be used to providea grace period to allow non-blocked memory store operations to a storebuffer (not shown) to complete before transitioning to the “slow” coreclock state 31B after an L2 cache miss. The M counter can be used toprovide a grace period to allow an internal (L1) cache miss to beprocessed before transitioning to the “slow” core clock state 31B aftera L2 cache miss. The N counter can be used to provide a grace period toallow pending long-latency instructions, such as multiply or divide, tocomplete before transitioning to the “slow” core clock state 31B after aL2 cache miss. These counters can be programmable in some embodimentsallowing dynamic tuning by software.

The elements of this embodiment of CCFC unit 14 are interconnected asfollows. Finite state machine 31 is connected to gating circuit 33 via aline 34, which propagates the SLOW_SELECT signal. Gating circuit 33 isconnected to receive an oscillating output signal from phase lock loop32 via a line 35. In addition, gating circuit 33 outputs a gated coreclock signal via an output line 37.

In operation, depending on its state, finite state machine 31 monitorsthe operation of processor 11 (FIG. 1) for selected conditions thatindicate that the state should be changed. For example, if finite statemachine 31 is in the “fast” core clock state 31A, finite state machine31 monitors the operation of processor 11 for selected conditions toenter the “slow” core clock state 31B. Similarly, if finite statemachine 31 is in the “slow” core clock state 31B, finite state machine31 monitors the operation of processor 11 for selected conditions toenter the “fast” core clock state 31A. As previously stated, after aRESET operation, finite state machine 31 enters the “fast” core clockstate 31A.

In this embodiment, phase lock loop 32 outputs a relatively “fast” coreclock signal (i.e., the CORE_CLK signal) with a frequency commonly inthe GHz or near GHz range. In some embodiments, phase lock loop 32 canbe controlled to change the frequency of its output signal, but thisfrequency control feature is separate from the operation of CCFC unit14. In other embodiments, a different circuit can be used to output theCORE_CLK signal (e.g., an oscillator, an delay lock loop (DLL); afrequency divider, an external clock circuit, etc.)

Gating circuit 33 receives the CORE_CLK signal from phase lock loop 32via line 35 and the SLOW_SELECT signal from finite state machine 31 vialine 34. In this embodiment, when the SLOW_SELECT signal is de-asserted(i.e., when finite state machine 31 is in the “fast” core clock state31A), gating circuit 33 outputs at output line 37 a GATED_CORE_CLKsignal that has the same frequency as the CORE_CLK signal. TheGATED_CORE_CLK signal is distributed as the “core clock” signal to thefunctional units of processor 11 (described above in conjunction withFIG. 1).

However, when the SLOW_SELECT signal is asserted (i.e., when finitestate machine 31 is in the “slow” core clock state 31B), gating circuit33 outputs at output line 37 the GATED_CORE_CLK signal with a frequencythat is less than that of the CORE_CLK signal. In this embodiment,gating circuit 33 causes the frequency to be substantially equal to thatof bus 15 (FIG. 1), which is typically significantly less than theCORE_CLK signal. For example, the CORE_CLK signal may be in the GHz ornear GHz range while the operating frequency of bus 15 is 400 MHz.

In one embodiment, gating circuit 33 masks selected clock cycles of theCORE_CLK signal rather than change the period. This masking techniquecan reduce glitches (e.g. losing clock edges) in the GATED_CORE_CLKsignal when finite state machine 31 transitions between the “slow” and“fast” core clock states 31A and 31B. In addition, in some embodiments,gating circuit 33 can be configured to help keep transitions of theGATED_CORE_CLK signal properly aligned with clock signal transitions ofthe operating frequency of bus 15; however, such embodiments tend to bemore complex, which may be undesirable in some applications.

FIG. 4 illustrates an implementation of gating circuit 33 (FIG. 3),according to one embodiment of the present invention. In thisembodiment, gating circuit 33 includes a mask generator 41 and two-inputAND gates 43 and 45. In this embodiment, mask generator 41 generates aMASK signal that is used to gate the CORE_CLK signal from phase lockloop 32 (FIG. 3). As previously described, in one embodiment gatingcircuit 33 masks out selected clock cycles of the CORE_CLK signal, whichserves to effectively reduce the frequency of the resulting maskedsignal (i.e., the GATED_CORE_CLK signal).

The elements of this embodiment of gating circuit 33 are interconnectedas follows. Mask generator 41 has two input leads, one connected to line34 to receive the SLOW_SELECT signal and an input lead 46 connected toline 35 to receive the CORE_CLK signal. Mask generator 41 also has anoutput lead connected to an inverting input lead of AND gate 43 via aline 47. AND gate 43 has another input lead (non-inverting) connected toline 35 and an output lead connected to an input lead (non-inverting) ofAND gate 45 via a line 48. The other input lead (inverting) of AND gate45 is connected to a line 49 to receive a CLOCK_DISABLE (or STOP CLOCK)signal. AND gate 45 outputs the GATED_CORE_CLK signal via line 37.

In operation, when the CLOCK_DISABLE signal on line 49 is at a logichigh level, the inverting input lead of AND gate 45 will cause AND gate45 to output the GATED_CORE_CLK signal at a logic low level whatever thelogic states of the SLOW_SELECT, MASK, and CORE_CLK signals.

When the CLOCK_DISABLE signal is at a logic low level, AND gate 45functions, in effect, like a non-inverting buffer. In this circumstance,AND gate 45 will output whatever signal is present on line 48 as theGATED_CORE_CLK signal. The signal present on line 48 is generated asfollows.

AND gate 43 serves to gate the CORE_CLK signal onto line 48, based onthe logic level of the MASK signal received via line 47. When the MASKsignal is at a logic low level, the inverting input lead of AND gate 43will cause AND gate to function as a non-inverting buffer, therebyoutputting the CORE_CLK signal onto line 48. In this way, the CORE_CLKsignal is not masked (i.e., propagated as the GATED_CORE_CLK signal viaAND gates 43 and 45).

However, when the MASK signal is at a logic high level, the invertinginput lead of AND gate 43 cause AND gate 43 to output a logic low levelsignal onto line 48 whatever the logic level of the CORE_CLK signal. Aspreviously described, a logic low level on line 48 causes AND gate 45 tooutput the GATED_CORE_CLK signal with a logic low level. In this way,the CORE_CLK signal is masked.

Mask generator 41 generates the MASK signal when the SLOW_SELECT signalis asserted. As previously described, the MASK signal is used to maskout selected clock cycles of the CORE_CLK signal (via AND gates 43 and45 as described below). In this embodiment, mask generator 41 causes theMASK signal to be at logic high levels during clock cycles that are tobe masked. On the other hand, when the SLOW_SELECT signal isde-asserted, mask generator 41 causes the MASK signal to remain in alogic low level, thereby not masking any clock cycles of the CORE_CLKsignal. An example of the masking is illustrated in FIG. 5.

FIG. 5 illustrates the timing of gating circuit 33 (FIG. 4), accordingto one embodiment of the present invention. In this exemplaryembodiment, the CORE_CLK signal has a frequency of 900 MHz and thedesired GATED_CORE_CLK signal has a frequency of 400 MHz. In particular,in this embodiment, for every nine cycles of the CORE_CLK signal, fivecontiguous clock cycles of the CORE_CLK signal are masked, therebyallowing four clock cycles to propagate in the GATED_CORE_CLK signal. Inthis way, a 400 MHz signal is generated. In other embodiments, themasked cycles of the CORE_CLK signal need not be contiguous.

FIG. 6 illustrates an implementation of mask generator 41 (FIG. 4),according to one embodiment of the present invention. In thisembodiment, mask generator 41 includes a three-input multiplexer 60(each input port being a five-bit input port), a parallel load register61, a comparator 62 (each input port being a five-bit input port), asingle bit register 63, a two-input AND gate 64, an increment circuit65, and another comparator 66 (each input port being a five-bit inputport).

In this embodiment, comparators 62 and 66 each compares two five-bitinput signals received at a “positive” input port and a “negative” inputport and outputs a single bit signal indicating whether the “positive”signal is greater than the “negative” signal. Increment circuit 65, inthis embodiment, receives a five-bit signal and outputs the five-bitsignal, incremented by one. For example, increment circuit 65 can beimplemented as a decoder circuit that decodes five-bit signals intoincremented five-bit signals.

The elements of this embodiment of mask generator 41 are interconnectedas follows. Multiplexer 60 is connected to receive five-bit inputsignals “00001” and “00000” at two of its input ports. In a typicalembodiment, these values are fixed but may be programmable in otherembodiments. For example, these signals can be hardwired to the supplyrails, or can be provided by registers or other memory devices (e.g.,non-volatile devices such as fuses or antifuses). The third input portof multiplexer 60 is connected to an output port of increment circuit65. The output port of multiplexer 60 is connected to the parallel loadinput port of register 61. Multiplexer 60 has a two lead control port,one control lead being connected to a line 67 to receive a RESET_SYNCsignal and the other control lead being connected to an output lead 68of comparator 66.

Comparator 66, in this embodiment, has its “negative” input portconnected to receive a five-bit signal “01001” (corresponding to a 900MHz CORE_CLK signal), and its “positive” input port connected to theoutput port of increment circuit 65. In some embodiments, this five-bitsignal can be programmable to operate with varying rates of “Fast” clock(e.g., via registers or other memory devices).

In this embodiment, register 61 has a clock input terminal connected toline 35 to receive the CORE_CLK signal and a five-bit output portconnected to the input port of increment circuit 65.

Comparator 62 has its “positive” input port connected the output port ofregister 61, its “negative” input port connected to receive a five-bitsignal “00100” (corresponding to a 400 MHz GATED_CORE_CLK signal), andits output lead connected to the input terminal of register 63 via aline 69. In some embodiments, this five-bit input signal can beprogrammable to operate with varying rates of “Slow” clock (e.g., viaregisters or other memory devices). Register 63 has an inverting clockinput terminal connected to line 35 (causing register 63 to be, ineffect, delayed by a half cycle relative to register 61) and an outputlead connected one input lead of AND gate 64. The other input lead ofAND gate 64 is connected to line 34 to receive the SLOW_SELECT signal.The output lead of AND gate 64 is connected to line 4 (to propagate theMASK signal).

In operation, when the SLOW_SELECT signal is at a logic low level (i.e.,during the “fast” core clock state 31A in FIG. 3), AND gate 64 outputs alogic low signal whatever the logic level of the output signal ofregister 63. As a result, the MASK signal at line 47 is at a logic lowlevel, thereby not masking the CORE_CLK signal as described above inconjunction with the embodiment of FIG. 4.

In contrast, when the SLOW_SELECT signal is at a logic high level (i.e.,during the “slow” core clock state 31B in FIG. 3), AND gate 64 functionsas a non-inverting buffer for the output signal of register 63. Thus,when the output signal of register 63 is at a logic high level, the MASKsignal at line 47 has a logic high level, thereby masking the CORE_CLKsignal as previously described in conjunction with the embodiment ofFIG. 4.

For this discussion of the operation during the “slow” core clock state31B (FIG. 4), the output signal of AND gate 64, the output signals ofregisters 61 and 63, comparators 62 and 66, and the RESET_SYNC andCORE_CLK signals are “initially” at logic low levels. The current logiclow level outputted by register 63 causes AND gate 64 to output the MASKsignal with a logic low level. As previously described, the logic lowlevel of the MASK signal allows gating circuit 33 (FIG. 4) to propagatethe CORE_CLK signal as the GATED_CORE_CLK signal.

Multiplexer 60 is configured to select one of the five-bit signalspresent at its three input ports, according to the logic levels at lines67 and 68. In this embodiment, when lines 67 and 68 are both at logiclow levels, multiplexer 60 selects the output signal of incrementcircuit 65. When lines 67 and 68 are at logic low and logic high levels,respectively, multiplexer 60 selects the “00000” signal. When line 67 isat a logic high level, multiplexer 60 selects the “00001” signal. Thus,because lines 67 and 68 are both at logic low levels and register 61outputs “00000” (which causes increment circuit 65 to output a “00001”signal), multiplexer 60 outputs a “00001” signal (received fromincrement unit 65) to the input port of register 61.

On the rising edge of the CORE_CLK signal (i.e., cycle 1), register 61loads the “00001” from multiplexer 60, and register 63 loads a “0” fromcomparator 62. Then the “00001” signal from register 63 is outputted tocomparator 62 and increment circuit 54. Because “00001” is less than“00100”, comparator 62 outputs a logic low level to register 63 via line69.

Increment circuit 65 then outputs a five-bit signal with a binary valuethat is one greater than that of the five-bit signal outputted byregister 61. Thus, at this stage, increment circuit 65 outputs a “00010”signal to comparator 66. This value is less than the “01001” signalreceived at the negative input port, so comparator 66 continues tooutput a logic low level on line 68. Consequently, multiplexer 60continues to select the output signal of increment circuit 65 (i.e.,“00010” at this point).

On the falling edge of the CORE_CLK signal, register 63 loads the logiclow level signal on line 69. Thus, register 63 outputs a logic low levelto AND gate 64, which causes AND gate 64 to output the MASK signal witha logic low level.

On the next rising edge of the CORE_CLK signal (i.e., cycle 2), register61 loads the “00010” signal from multiplexer 60. Register 61 now outputs“00010” to comparator 62 and to increment circuit 65. Because “00010” isless than “00100”, comparator 62 continues to output a logic low levelon line 69. Also, the “00010” signal from register 61 causes incrementcircuit 65 to output a “00011” to comparator 66 and multiplexer 60.Because “00011” is not greater than “01001”, comparator 66 continues tooutput a logic low level signal on line 68. Thus, multiplexer 60continues to select the output signal from increment circuit 65, whichhas transitioned to “00011”.

On the falling edge of the CORE_CLK signal, register 63 loads the logiclow level on line 69 from comparator 62. Thus, register 63 continues tooutput a logic low level, which causes AND gate 64 to continue to outputthe MASK signal with a logic low level.

Similarly, on the next rising edge of the CORE_CLK signal (i.e., cycle3), register 61 loads the “00011” signal from multiplexer 60. Register61 now outputs “00011” to comparator 62 and to increment circuit 65.Because “00011” is less than “00100”, comparator 62 continues to outputa logic low level on line 69. Also, the “00011” signal from register 61causes increment circuit 65 to output a “00100” to comparator 66 andmultiplexer 60. Because “00100” is less than “01001”, comparator 66continues to output a logic low level signal on line 68. Thus,multiplexer 60 continues to select the output signal from incrementcircuit 65, which has transitioned to “00100”.

On the falling edge of the CORE_CLK signal, register 63 loads the logiclow level on line 69 from comparator 62. Thus, register 63 continues tooutput a logic low level, which causes AND gate 64 to continue to outputthe MASK signal with a logic low level.

However, on the next rising edge of the CORE_CLK signal (i.e., cycle 4),register 61 loads the “00100” signal from multiplexer 60. Register 61now outputs “00100” to comparator 62 and to increment circuit 65. The“00100” signal from register 61 causes increment circuit 65 to output a“00101” to comparator 66 and multiplexer 60. Because “00101” is lessthan “01001”, comparator 66 continues to output a logic low level signalon line 68. Thus, multiplexer 60 continues to select the output signalfrom increment circuit 65, which has transitioned to “00101”. However,because the “00100” from register 61 is not less than “00100” receivedat its negative input port, comparator 62 now outputs a logic high levelto register 63 via line 69.

On the falling edge of the CORE_CLK signal, register 63 loads the logichigh level on line 69 from comparator 62. Thus, register 63 now outputsa logic high level, which causes AND gate 64 to output the MASK signalwith a logic high level, thereby causing gating circuit 33 to mask theCORE_CLK signal as previously described. As a result, the first fourclock cycles of the CORE_CLK signal were not masked, while the fifthclock cycle will be masked.

On the next rising edge of the CORE_CLK signal (i.e., cycle 5), register61 loads the “00101” signal from multiplexer 60. Register 61 now outputs“00101” to comparator 62 and to increment circuit 65. Because “00101” isnot less than “00100”, comparator 62 continues to output a logic highlevel on line 69. Also, the “00101” signal from register 61 causesincrement circuit 65 to output a “00110” to comparator 66 andmultiplexer 60. Because “00110” is less than “01001”, comparator 66continues to output a logic low level signal on line 68. Thus,multiplexer 60 continues to select the output signal from incrementcircuit 65, which has transitioned to “00110”.

On the falling edge of the CORE_CLK signal, register 63 loads the logichigh level on line 69 from comparator 62. Thus, register 63 continues tooutput a logic high level, which causes AND gate 64 to continue tooutput the MASK signal with a logic high level.

Mask generator 41 operates in a similar manner (i.e., to cycle 5) forclock cycles 6 and 7, with the value stored by register 61 beingincremented with each clock cycle of the CORE_CLK signal. However, oncycle 8, register 61 loads a “01000” signal from multiplexer 60.Register 61 now outputs “01000” to comparator 62 and to incrementcircuit 65. Because “01000” is greater than “00100”, comparator 62continues to output a logic high level on line 69. Also, the “01000”signal from register 61 causes increment circuit 65 to output a “01001”to comparator 66 and multiplexer 60. Because “01001” signal fromincrement circuit 65 is not less than the “01001” signal received at its“negative” input port, comparator 66 outputs a logic high level signalon line 68. Thus, multiplexer 60 selects the “00000” signal.

On the falling edge of the CORE_CLK signal, register 63 loads the logichigh level on line 69 from comparator 62. Thus, register 63 continues tooutput a logic high level, which causes AND gate 64 to continue tooutput the MASK signal with a logic high level. Thus, cycles 5-9 of theCORE_CLK signal will be masked.

On the rising edge of cycle 9, register 61 loads the “00000” signal frommultiplexer 60. Register 61 now outputs “00000” to comparator 62 and toincrement circuit 65. Because “00000” is less than “00100”, comparator62 now outputs a logic low level on line 69. Also, the “00000” signalfrom register 61 causes increment circuit 65 to output a “00001” tocomparator 66 and multiplexer 60. Because “00001” is less than “01001”,comparator 66 now outputs a logic low level signal on line 68. Thus,multiplexer 60 now selects the output signal from increment circuit 65,which has transitioned to “00001”.

On the falling edge of the CORE_CLK signal, register 63 loads the logiclow level on line 69 from comparator 62. Thus, register 63 now outputs alogic low level, which causes AND gate 64 to output the MASK signal witha logic low level. As a result, during cycle 10, the CORE_CLK signalwill not be masked. The process is then restarted, with cycle 10 beingperformed as described above for cycle 1 for as long as the SLOW_SELECTsignal is asserted.

When a reset operation is performed while the SLOW_SELECT signal isasserted, multiplexer 60 will select the “00001” signal so that the masksignal will be properly aligned from a rising edge of the clock signalfor bus 15 (FIG. 1).

In alternative embodiments, different circuitry may be used to implementmask generator 41.

FIG. 7 illustrates an implementation of a gating circuit 33A (FIG. 3)for use with a source synchronous bus, according to another embodimentof the present invention. As is known in the art, a source synchronousbus in effect divides a bus clock cycle into multiple segments (e.g.,four) by using multiple data strobe signals. Each data strobe signal issampled, requiring four accurately timed sampling edges. The unitgenerating the sampling edges, therefore, cannot receive theGATED_CORE_CLK signal and still allow the processor to monitor bus 15(FIG. 1). Further, in order to preserve seamless transitions between the“slow” and “fast” core clock states 31A and 31B (FIG. 3), theGATED_CORE_CLK signal should be aligned and configured so that thesource synchronous sampling edges will be properly timed. For example,in one embodiment, the GATED_CORE_CLK signal is generated so that thereis an edge after or together with every external bus clock edge.Otherwise, if there are two consecutive bus clock transitions while nonein the GATED_CORE_CLK signal, then an incoming datum will be lost (notsampled). The waveform of the GATED_CORE_CLK signal may be tailored invarious fashions to work properly with the target bus clock. Forinstance, gating circuit 33A can be configured to generate a moresymmetric wave (e.g., in duty cycle), which would be easier to matchwith a symmetric 400 MHz on the external bus.

In this embodiment, gating circuit 33A includes a source synchronousedge generator (SSEG) unit 71 and a mask generator unit 71. Maskgenerator unit 71 is similar in function to mask generator 41 and ANDgates 43 and 45 (FIG. 4) in that mask generator unit 71 generates theGATED_CORE_CLK signal. In one embodiment, SSEG unit 71 receives theCORE_CLK signal and in response generates a SOURCE_SYNC_CORE_CLK signalthat meets the timing requirements of the source synchronous bus. Maskgenerator unit 71 then uses the SOURCE_SYNC_CORE_CLK signal to have anedge after or together with every external bus clock edge. Thisembodiment advantageously allows processor 11 (FIG. 1) to monitor thesource synchronous bus during the “slow” core clock state 31B (FIG. 3).

Embodiments of method and apparatus for a clock frequency control unitare described herein. In the above description, numerous specificdetails are set forth (implementations of gating circuit 33, maskgenerator 41, etc.) to provide a thorough understanding of embodimentsof the invention. One skilled in the relevant art will recognize,however, that embodiments of the invention can be practiced without oneor more of the specific details, or with other methods, components,materials, etc. In other instances, well-known structures, materials, oroperations are not shown or described in detail to avoid obscuring thedescription.

Reference throughout this specification to “one embodiment” or “anembodiment” means that a particular feature, structure, orcharacteristic described in connection with the embodiment is includedin at least one embodiment of the present invention. Thus, theappearances of the phrases “in one embodiment” or “in an embodiment” invarious places throughout this specification are not necessarily allreferring to the same embodiment. Furthermore, the particular features,structures, or characteristics may be combined in any suitable manner inone or more embodiments.

In addition, embodiments of the present description may be implementednot only within a semiconductor chip but also within machine-readablemedia. For example, the designs described above may be stored uponand/or embedded within machine readable media associated with a designtool used for designing semiconductor devices. Examples include anetlist formatted in the VHSIC Hardware Description Language (VHDL)language, Verilog language or SPICE language. Some netlist examplesinclude: a behavioral level netlist, a register transfer level (RTL)netlist, a gate level netlist and a transistor level netlist.Machine-readable media also include media having layout information suchas a GDS-II file. Furthermore, netlist files or other machine-readablemedia for semiconductor chip design may be used in a simulationenvironment to perform the methods of the teachings described above.

Thus, embodiments of this invention may be used as or to support asoftware program executed upon some form of processing core (such as theCPU of a computer) or otherwise implemented or realized upon or within amachine-readable medium. A machine-readable medium includes anymechanism for storing or transmitting information in a form readable bya machine (e.g., a computer). For example, a machine-readable medium caninclude such as a read only memory (ROM); a random access memory (RAM);a magnetic disk storage media; an optical storage media; and a flashmemory device, etc. In addition, a machine-readable medium can includepropagated signals such as electrical, optical, acoustical or other formof propagated signals (e.g., carrier waves, infrared signals, digitalsignals, etc.).

The above description of illustrated embodiments of the invention,including what is described in the Abstract, is not intended to beexhaustive or to be limitation to the precise forms disclosed. Whilespecific embodiments of, and examples for, the invention are describedherein for illustrative purposes, various equivalent modifications arepossible, as those skilled in the relevant art will recognize.

These modifications can be made to embodiments of the invention in lightof the above detailed description. The terms used in the followingclaims should not be construed to limit the invention to the specificembodiments disclosed in the specification and the claims. Rather, thescope is to be determined entirely by the following claims, which are tobe construed in accordance with established doctrines of claiminterpretation.

1. A method comprising: when an integrated circuit (IC) is operating ina first state, monitoring the IC's operation for a first set of selectedconditions, the IC having a plurality of functional units, the pluralityof functional units receiving a clock signal with a first frequency whenthe IC is operating in the first state, the first set of selectedconditions being indicative of a low workload period in the IC; waitingfor at least one of a plurality of programmable grace periods to expireafter detecting that one of the first set of selected conditions issatisfied; and causing the IC to operate in a second state afterexpiration of the one of the plurality of programmable grace periods,wherein in the second state the clock signal has a second frequency thatis less than the first frequency, wherein one of the plurality ofprogrammable grace periods is selected to allow one or more pendingstore operations to be processed prior to the IC operating in the secondstate.
 2. The method of claim 1, further comprising: when the IC isoperating in the second state, monitoring the IC's operation for asecond set of selected conditions, the second set of selected conditionsbeing indicative of the termination of the low workload period; andcausing the IC to operation in the first state when the second set ofselected conditions is satisfied.
 3. The method of claim 1, wherein theIC comprises a processor.
 4. The method of claim 2, wherein the firstset of selected conditions includes: a cache miss signal being assertedby a level two cache.
 5. The method of claim 1, wherein one of theplurality of programmable grace periods is selected to allow operationswaiting in one or more reservation stations to be executed.
 6. Themethod of claim 2, wherein the second set of selected conditionscomprises a signal indicating that the level two cache is ready for amemory transaction.
 7. The method of claim 2, wherein one of theplurality of programmable grace periods is selected to allow theprocessor to complete an arithmetic operation.
 8. The method of claim 7,wherein the arithmetic operation is a multiply or a divide operation. 9.The method of claim 2, wherein the second set of selected conditionscomprises a receipt of a snoop request.
 10. The method of claim 2,wherein the second set of selected conditions comprises assertion of aninterrupt signal.
 11. The method of claim 2, wherein the second set ofselected conditions comprises assertion of a reset signal.
 12. Themethod of claim 2, wherein the second set of selected conditionscomprises assertion of a stop clock signal.